#pragma once

#ifdef SECUREAUTOBACKUP_EXPORTS
#define SECUREAUTOBACKUP_API __declspec(dllexport)
#else
#define SECUREAUTOBACKUP_API __declspec(dllimport)
#endif

#include <list>
#include "..\lib\atl\include\atlrx.h"

#include "BackupInfo.h"
#include "FileInfo.h"

class SECUREAUTOBACKUP_API ProjectInfo
{
public:
	CString projectName;
	CString projectLocation;
	CString bakprjFile;

	CString fullBackupPath;
	CString incBackupPath;
	CString difBackupPath;
	CString difincBackupPath;

	std::list<BackupInfo> fullBackupInfoList;
	std::list<BackupInfo> incBackupInfoList;
	std::list<BackupInfo> difBackupInfoList;
	std::list<BackupInfo> difincBackupInfoList;
	BackupInfo* selectedBackup;
	BackupInfo currentBackup;

	CString recoveryPath;

	std::list<FileInfo> selectedFileList;
	std::list<FileInfo> selectedDirList;
	std::list<CString> selectedBackupList;

	int m_CurSelTabFrm;
	int m_CurSelTabFrmOfBackup;
	int m_CurSelTabRecoveryList;

	int autoCycle;
	int autoHour;
	int autoMin;
	bool isAutoBackupOnce;

	CAtlRegExp<> fileFilterReg;
	BOOL isInclude;

	int backupProgress;

	// methods
	ProjectInfo(void);
	~ProjectInfo(void);
	void Clear();
	BOOL SaveProject();
	BackupInfo* GetlatestFullBackup();
	BackupInfo* GetlatestIncBackup();
	BackupInfo* GetlatestFullOrIncBackup();
	BOOL GetHistoryBackupList(std::list<BackupInfo*>& historyBackupList, BackupInfo* backupInfo = NULL);
	BOOL AddHistoryBackupListRecursively(std::list<BackupInfo*>& historyBackupList);
	BackupInfo* FindBackupInList(CString name, std::list<BackupInfo>& list);

};
